gtkwidget: Queue a resize on the parent when unparenting
authorTimm Bäder <mail@baedert.org>
Mon, 24 Apr 2017 17:07:59 +0000 (19:07 +0200)
committerTimm Bäder <mail@baedert.org>
Tue, 25 Apr 2017 18:30:37 +0000 (20:30 +0200)
gtk_widget_set_parent (via gtk_widget_reposition_after) will queue a
resize on the parent widget automatically when adding a child widget, so
unparent should do the same

gtk/gtkwidget.c

index 0264c279e4640f558e8e1e080c45a1d50fbb199b..0e5fd477611d66a7ad83ab30b5baf5ef46d128d7 100644 (file)
@@ -4021,6 +4021,9 @@ gtk_widget_unparent (GtkWidget *widget)
                                priv->clip.width,
                                priv->clip.height);
 
+  if (priv->visible && _gtk_widget_get_visible (priv->parent))
+    gtk_widget_queue_resize (priv->parent);
+
   /* Reset the width and height here, to force reallocation if we
    * get added back to a new parent. This won't work if our new
    * allocation is smaller than 1x1 and we actually want a size of 1x1...